package common.dto;

import com.github.javafaker.Faker;
import common.entity.Address;
import common.entity.User;

import java.util.Locale;
import java.util.Random;

public class UserDaoImpl implements UserDao {
    Faker faker = Faker.instance(Locale.CHINA);

    @Override
    public User getUser() {
        if (new Random().nextBoolean()) {
            return new User(faker.name().username(), new Address(faker.number().randomDigit(), faker.address().fullAddress()));
        }
        return null;
    }
}
